/**
 * 这里记录 view的写法
 * */
import 'package:flutter/material.dart';
import 'package:study_flutter/yzhg/function/NetLoadingDialog.dart';

import '../YConstant.dart';

class ViewDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Wrap(
      spacing: 4.0,
      runSpacing: 4.0,
      alignment: WrapAlignment.center,
      children: <Widget>[
        RaisedButton(
          onPressed: () async {
            return new NetLoadingDialog(outsideDismiss: false);
            /*  Navigator.of(context)
              .pushNamed(YConstant.TIP_ROUTE_PAGE, arguments: "我是传值Info")
              .then((value) {
              print("路由返回值: $value");
            });*/
          },
          child:
              Text("路由传值", style: TextStyle(fontSize: 14, color: Colors.blue)),
        ),
        RaisedButton(
            onPressed: () {
              Navigator.pushNamed(context, YConstant.PACKAGE_MANAGE_PAGE);
            },
            child: Text("包管理",
                style: TextStyle(fontSize: 14, color: Colors.blue))),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.PACKAGE_RESOURCE_MANAGER);
          },
          child:
              Text("资源管理", style: TextStyle(fontSize: 14, color: Colors.blue)),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.of(context).pushNamed(YConstant.PACKAGE_WIDGET_STUDY);
          },
          child: Text(
            "Widget学习",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.WEIGHT_STATE);
          },
          child: Text(
            "State生命周期",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.WIDGET_SNACKBAR);
          },
          child: Text(
            "SnackBar学习",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () async {
            Navigator.of(context)
                .pushNamed(YConstant.VIEW_TEXT_STUDY, arguments: "我是传值Info")
                .then((value) {
              print("路由返回值: $value");
            });
          },
          child: Text(
            "Text文本",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () async {
            Navigator.of(context)
                .pushNamed(YConstant.VIEW_BUTTON_STUDY, arguments: "我是传值Info")
                .then((value) {
              print("路由返回值: $value");
            });
          },
          child: Text(
            "按钮",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.VIEW_IMAGE_STUDY);
          },
          child: Text(
            "image",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.VIEW_SWITCH_CHECKBOX);
          },
          child: Text(
            "单选框和复选框",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.VIEW_INPUT_FORM);
          },
          child: Text(
            "Input和表单",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.VIEW_PROGRESS_DEMO);
          },
          child: Text(
            "Progress",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.VIEW_ROW_COLUMN);
          },
          child: Text(
            "线性布局",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.CONTAINER_DEMO);
          },
          child: Text(
            "容器",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.DECORATED_BOX);
          },
          child: Text(
            "装饰容器",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.TAB_BOTTOM_BAR);
          },
          child: Text(
            "TabBar和底部导航",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.SCROLLABLE_DEMO);
          },
          child: Text(
            "可滚动组件",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
        RaisedButton(
          onPressed: () {
            Navigator.pushNamed(context, YConstant.LISTVIEW_BUILDER_DEMO);
          },
          child: Text(
            "ListViewBuilder",
            style: TextStyle(fontSize: 14, color: Colors.blue),
          ),
        ),
      ],
    );
  }
}
